Chapters 4, 5 & 6 โ complete notes with definitions, analogies, memory tricks, interactive tools, flashcards and a quiz covering all past-paper topics.
Turing machines, AI, ethics, environment, the Internet & emerging tech. On every paper!
4A Turing Machine is a theoretical computing device proposed by Alan Turing in 1936. It has: an infinite tape divided into cells, a read/write head, a finite set of states, and a transition table. By reading symbols and changing state, it can compute anything computable. It is the mathematical model behind every modern computer.
A Turing Machine is like a very simple post-office worker on an infinitely long conveyor belt. They read the next package (cell), follow a rulebook (transition table), write on it, and move left or right. Simple rules, infinite power!
Turing-complete โ any system or programming language capable of simulating a Turing machine, meaning it can carry out any computation given enough time and memory. Python, Java, C are all Turing-complete. (DEB 2023 asked this directly.)
The 2022 exam had you trace a Turing machine. The table shows: Current State + Symbol Read โ Write Symbol, then move Right (R) or Left (L), then new State.
Example: Tape starts as 0 1 1 0 B (B = blank), head starts at position 0, state S0. Transition rule: if S0 reads 0 โ write 1, move R, stay S0; if S0 reads 1 โ write 0, move R, stay S0; if S0 reads B โ HALT.
This machine flips every bit!
State: S0 | Head at position 0
Turing Machine = Tape + Head + States + Transitions = "THST" โ "The Hard Stuff Today" ๐
2022 paper: trace a 4-state Turing machine step by step. Fill in: the current state, the symbol on the tape at the head, what gets written, which direction the head moves, and the new state. Go slowly, one step at a time!
| Generation | Technology | Era | Key milestone |
|---|---|---|---|
| 1st | Vacuum tubes | 1940s | ENIAC (1945) โ first electronic general-purpose computer |
| 2nd | Transistors | 1950s | Smaller, cheaper, more reliable than vacuum tubes |
| 3rd | Integrated circuits | 1960s | Jack Kilby โ multiple transistors on one chip |
| 4th | Microprocessors | 1970s+ | Intel 4004 โ entire CPU on a single chip |
| 5th | AI & Ubiquitous computing | Today | Machine learning, mobile, IoT, quantum |
Key figures to know: Charles Babbage (Analytical Engine โ first design for a programmable computer), Ada Lovelace (world's first programmer), Alan Turing (theoretical CS + WWII code-breaking), John von Neumann (stored-program concept), Tim Berners-Lee (invented the World Wide Web, 1989), Tony Hoare (invented Quicksort, 1960).
AI has appeared on EVERY paper since 2022. Memorise these definitions exactly.
Artificial Intelligence (AI) โ the branch of computer science concerned with building machines or programs that can perform tasks that would normally require human intelligence โ such as recognising speech, making decisions, learning from experience, and solving problems.
Machine Learning โ a subset of AI in which systems learn from data and improve over time without being explicitly programmed for every case.
Traditional programming: tell the computer exactly what to do for every situation. Machine Learning: show it thousands of examples and let it figure out the rules itself โ like training a dog with treats rather than writing out every command!
S-U-R = Supervised (teacher gives answers), Unsupervised (no labels, finds patterns), Reinforcement (learns from rewards). "Students Usually Reward good learning!"
Bias in ML occurs when a model's predictions systematically favour or disadvantage certain groups โ usually because the training data was unrepresentative.
How to reduce bias: use diverse, balanced training data; audit models for fairness; include diverse teams in design; test across different demographics; use bias-detection tools.
2025 paper: State a benefit AND a limitation of AI in medical diagnosis. Benefit: faster/more consistent screening, detects patterns humans miss. Limitation: biased if trained on narrow demographics; "black box" lack of explainability; liability issues.
| Scenario | ML or not? | Why |
|---|---|---|
| Netflix recommends shows based on your viewing history | โ YES | Learns from data over time, improves recommendations |
| Robotic lawnmower with fixed sensor rules | โ NO | Hard-coded rules, no learning from data |
| Spam filter that updates as new spam patterns emerge | โ YES | Improves performance from new examples |
| Calculator performing maths operations | โ NO | Follows fixed formulas, no learning |
The Internet is the global network of interconnected computer networks โ it is the hardware infrastructure (cables, routers, servers).
The Internet carries: email, FTP, video calls, online gaming, the Web, and more.
The World Wide Web (WWW) is a service that runs on the Internet โ an interconnected collection of websites and pages accessed via HTTP/HTTPS using browsers.
The Web is just ONE application that uses the Internet.
The Internet is like the road network โ the physical infrastructure. The World Wide Web is like Google Maps โ a service that uses those roads. You can also drive to a friends house (email) on the same roads without using Maps!
Internet = Infrastructure (the roads). Web = One service on those roads. "Internet is Infrastructure. Web is one Way to use it."
| Term | What it is | Example |
|---|---|---|
| HTTP | HyperText Transfer Protocol โ rules for browsers requesting web pages from servers | http://example.com |
| HTTPS | Secure HTTP โ encrypted with TLS/SSL. Protects data in transit. | https://mybank.ie |
| URL | Uniform Resource Locator โ the unique address of a resource on the web | https://example.com/page |
| Web Browser | Software to access and display web pages | Chrome, Firefox, Safari, Edge |
| Search Engine | Website/service that indexes the web and returns results for queries | Google, Bing, DuckDuckGo |
DEB 2024 asked you to distinguish a web browser from a search engine. Browser = software to VIEW pages. Search engine = website/service to FIND pages. You use the browser to access the search engine!
| Ethical Issue | Description |
|---|---|
| Privacy & surveillance | Constant data collection, location tracking, facial recognition by governments/companies |
| Algorithmic bias | AI systems unfairly disadvantaging certain groups due to biased training data |
| Intellectual property | Copyright, piracy, AI-generated content stealing original work |
| Digital divide | Unequal access to technology between rich/poor, urban/rural populations |
| Deepfakes | AI-generated fake videos/images used to spread misinformation or harm individuals |
| Automation & jobs | Robots and AI replacing human workers, causing unemployment |
| Data ownership | Who owns your personal data โ you or the company that collects it? |
GDPR (2018) is EU law that regulates how organisations collect, store, and use personal data. It gives individuals control over their own data.
| Your Rights Under GDPR | What it means |
|---|---|
| Right of Access | You can request a copy of all data held about you |
| Right to Rectification | You can correct inaccurate data |
| Right to Erasure | "Right to be forgotten" โ request deletion of your data |
| Right to Portability | Transfer your data to another service |
| Right to Object | Object to your data being used for certain purposes |
GDPR rights: A-R-E-P-O = Access, Rectification, Erasure, Portability, Object. "Are Regulations Ever Properly Obeyed?" ๐
| โ Advantages | โ Disadvantages |
|---|---|
| No upfront hardware investment | Ongoing subscription costs |
| Pay-as-you-go, easily scalable | Requires internet connection |
| Access from anywhere, real-time collaboration | Data security/privacy depends on provider |
| Automatic backups | Provider downtime = your downtime |
| Shared data centres are more efficient per user | Very large overall energy consumption |
The 2024 exam listed these. Know one advantage and one disadvantage for each!
2024 paper: "Describe one advantage and one disadvantage of quantum computing." Pick any trend above and apply the same structure: name it, advantage with explanation, disadvantage with explanation.
Examples of automation: robotic process automation (filling forms, sending invoices), industrial robots in factories, self-checkout, automated driving, scheduling/CI pipelines.
| โ Benefits | โ Limitations |
|---|---|
| Faster, consistent, 24/7 operation | High upfront cost |
| Reduces human error in repetitive tasks | Brittle โ fails if conditions change unexpectedly |
| Frees humans for higher-value work | Displaces workers, unemployment concerns |
| Scales easily with demand | Requires ongoing maintenance |
2025 paper asked about how computing automates processes with a limit โ always give a specific example (e.g. self-checkout) and a specific limitation (e.g. customers still need assistance when the machine errors).
Binary, hex, data types, character encoding, cryptography & cybersecurity. Heavy on calculations!
5Computers use binary (base 2) because transistors have exactly two states: ON (1) and OFF (0). This maps perfectly to physical electrical signals, making circuits simple and reliable.
Binary is like a row of light switches โ each is either ON (1) or OFF (0). With 8 switches (1 byte) you can make 256 different patterns (0โ255). More switches = more numbers you can represent!
Every bit position has a value that doubles as you go left. 8-bit place values:
| Position | 2โท | 2โถ | 2โต | 2โด | 2ยณ | 2ยฒ | 2ยน | 2โฐ |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example: 11001001 = 128+64+0+0+8+0+0+1 = 201
Example: 13 รท 2 = 6 R1 โ 6 รท 2 = 3 R0 โ 3 รท 2 = 1 R1 โ 1 รท 2 = 0 R1 โ Read bottom-up: 1101
Divide by 2 and collect remainders โ then read upwards! Like reading a stack of papers from the bottom.
Hexadecimal is a base-16 system using digits 0โ9 and letters AโF (where A=10, B=11, C=12, D=13, E=14, F=15). It is used as a compact shorthand for binary โ every byte = exactly 2 hex digits.
Hex is like a shorthand language for binary. Writing FF is easier than 11111111. That's why colour codes (#FF5733), memory addresses, and MAC addresses use hex โ fewer mistakes, easier to read!
| Decimal | Binary (nibble) | Hex |
|---|---|---|
| 0โ9 | 0000โ1001 | 0โ9 |
| 10 | 1010 | A |
| 11 | 1011 | B |
| 12 | 1100 | C |
| 13 | 1101 | D |
| 14 | 1110 | E |
| 15 | 1111 | F |
After 9 comes A B C D E F = 10 11 12 13 14 15. Mnemonic: "Amazing Binary Converter Delivers Exact Figures!"
Group binary into nibbles (groups of 4) from the right, then convert each nibble to one hex digit.
Example: 10110101 โ 1011|0101 โ B|5 โ B5โโ
Reverse: each hex digit expands to 4 binary bits. C9 โ 1100 1001
Multiply each hex digit by its place value (powers of 16).
Example C9โโ: C = 12, 9 = 9.
(12 ร 16ยน) + (9 ร 16โฐ) = 192 + 9 = 201 โ
2023 paper asked: convert C9โโ to decimal. DEB 2024 asked: convert binary to hex using nibble grouping. Practice these calculations until they're automatic!
Colour codes like #0A33F0 have 3 pairs of hex digits: RR GG BB. Convert each pair to decimal to get the RGB values.
Example #0A33F0: Red = 0Aโโ = 10, Green = 33โโ = (3ร16)+3 = 51, Blue = F0โโ = (15ร16)+0 = 240
2025 paper: convert #0A33F0 to RGB decimal. Method: split into 3 pairs (0A, 33, F0), convert each pair using the hexโdecimal formula. R=10, G=51, B=240.
Download time formula: Time (s) = File size (MB) รท Transfer rate (MB/s). To convert Mbps to MB/s: divide by 8 (8 bits per byte).
Internet speed is measured in megabits per second (Mbps), but file sizes are in megabytes (MB). Since 1 byte = 8 bits, divide speed by 8 to get MB/s. Like converting km/h to m/s โ different units, same thing!
Formula: File size (MB) รท (Speed Mbps รท 8). Remember: divide speed by 8 because there are 8 bits in a byte!
| Data Type | Description | Examples |
|---|---|---|
| Integer | Whole number (positive, negative, or zero) | 255, -99, 0, 42 |
| Float / Real | Number with a decimal point | 3.14, -99.99, 1.7 |
| String | Text โ any sequence of characters | "Ciara", "083-1234567", "Hello!" |
| Boolean | True or False only โ two possible values | True, False |
| List / Array | Ordered collection of values | [1.5, 1.7], ["red", "blue"] |
| Date | A calendar date or time | 2024-01-15, 14:30:00 |
2023 paper: identify the correct data type for: "Ciara" = String; 255 = Integer; 083-1234567 = String (leading 0 and dash); [1.5, 1.7] = List; False = Boolean; -99.99 = Float/Real. Common mistake: phone numbers are Strings because of leading zeros and dashes!
Phone numbers are Strings โ never Integers! You can't do maths with a phone number, and 083... has a leading zero which would be lost in Integer form.
Continuous data can take ANY value within a range โ including fractions and decimals. Examples: temperature, height, weight, speed, time.
Continuous = a dial (can be at any position). Temperature can be 20.5, 20.51, 20.512ยฐC โ infinite possible values between 20 and 21!
Discrete data can only take specific, separate values โ usually whole numbers or categories. Examples: number of students, shoe sizes, number of cars.
Discrete = a light switch (on or off, nothing between). You can have 30 students or 31 students, but never 30.5 students!
Character encoding is a system that assigns a number (binary code) to every character (letter, digit, symbol) so computers can store and transmit text.
| Feature | ASCII | Unicode (UTF-8/UTF-16) |
|---|---|---|
| Year created | 1963 (revised 1986) | 1991 (ongoing) |
| Bits per character | 7-bit (128 chars) or extended 8-bit (256 chars) | Variable: 8โ32 bits per character |
| Number of characters | 128 (standard) or 256 (extended) | 140,000+ characters |
| Languages supported | English/Latin only | ALL world scripts + emoji + maths |
| Memory use | Very compact (1 byte per char) | More memory (1โ4 bytes per char in UTF-8) |
| Compatibility | N/A | First 128 codes = same as ASCII (backwards compatible) |
ASCII is a tiny local library โ great for English books only. Unicode is the world's biggest library โ every book in every language, plus emoji! But a bigger library needs a bigger building (more memory).
ASCII = American โ English only. Unicode = Universal โ every language. Unicode was needed because by the 1980s, different countries had incompatible character sets that couldn't communicate with each other.
2025 paper: "Compare ASCII and Unicode in terms of memory use and compatibility." ASCII = less memory (7/8 bits), English only, not globally compatible. Unicode = more memory, supports all languages, globally compatible, backwards compatible with ASCII.
A Caesar Cipher shifts every letter in the alphabet by a fixed number n. To decode: shift each letter backwards by n, wrapping around using modulo 26.
Decode formula: Decoded position = (letter_position โ n) mod 26
Caesar cipher encode = shift forward n. Decode = shift backward n. Modulo handles the wrap-around (after Z comes A). DEB 2023 used shift n=7. HELLO shifted by 7 = OLSSV.
The Pigpen cipher uses two key grids โ a # grid and an X grid โ where each letter's position in the grid becomes its symbol (the shape of the segment it sits in).
To decode: match the shape of each symbol to the matching segment in the key diagram. Pure pattern recognition, no maths!
DEB 2024 asked you to decode a Pigpen message using a given key diagram. Strategy: look at the shape (the lines/corners), find which grid segment has that shape, and read the letter inside.
Ransomware is malware that encrypts the victim's files and demands payment (ransom) to restore access. The 2022 paper used the HSE cyberattack as a case study.
Ransomware is like someone breaking into your house, locking all your belongings in a safe, and demanding money for the combination. Pay and you might (or might not) get your stuff back!
| Security Measure | How it helps |
|---|---|
| Encryption | Makes data unreadable without the decryption key โ even if stolen, data is useless |
| Multi-factor authentication (MFA) | Requires 2+ proofs of identity โ password + phone code |
| VPN | Creates an encrypted tunnel for remote workers |
| Firewall | Blocks unauthorised network access |
| Regular backups | Offline backups allow recovery if data is lost/encrypted |
| Staff training | Most breaches start with human error (phishing emails) |
| Software updates/patches | Fixes known security vulnerabilities |
DEB 2024: "State 3 methods to protect data in a database." DEB 2023: "State 3 IT security measures for remote working." Good answers: encryption, MFA/strong passwords, VPN, regular backups, firewalls, patch management.
Bubble, Insertion, Selection, Quicksort, Binary Search & Big O. Sorting appears on EVERY paper!
6Big O notation describes the relationship between the size of the input (N) and the number of steps an algorithm takes. It measures the amount of work โ NOT actual speed โ and tells you how the algorithm scales as input grows.
Big O is like asking: "If I double the number of students in a class, how much longer does the roll-call take?" O(n) = twice as long. O(nยฒ) = four times as long. O(log n) = barely any longer!
| Input size (n) | O(nยฒ) operations | Meaning |
|---|---|---|
| 5 | ~25 | 5 ร 5 = manageable |
| 10 | ~100 | Doubled input โ 4x the work |
| 100 | ~10,000 | Starting to get slow |
| 1,000 | ~1,000,000 | Very slow! |
Best โ Worst: O(1) โ O(log n) โ O(n) โ O(n log n) โ O(nยฒ)
"One Lucky ninja never needs nยฒ ninjas!" ๐ฅท
DEB 2024: "Sort these Big O complexities from best to worst." Answer: O(1) โ O(log n) โ O(n) โ O(n log n) โ O(nยฒ). Also know which algorithm gives which: Binary Search = O(log n), Linear Search = O(n), Quicksort avg = O(n log n), Bubble/Insertion/Selection = O(nยฒ).
Bubble Sort compares adjacent pairs and swaps them if they're in the wrong order. After each full pass, the largest unsorted element "bubbles up" to its correct position at the end.
Like bubbles rising in water โ the biggest bubble always floats to the top first. After each pass, one more element is in its correct position at the end, and you never need to look at it again!
arr[0] > arr[1], swap them.| Pass | List after pass | Element placed |
|---|---|---|
| Start | [50, 70, 30, 60, 20] | โ |
| Pass 1 | [50, 30, 60, 20, 70] | 70 โ end โ |
| Pass 2 | [30, 50, 20, 60, 70] | 60 โ position 4 โ |
| Pass 3 | [30, 20, 50, 60, 70] | 50 โ position 3 โ |
| Pass 4 | [20, 30, 50, 60, 70] | 30 โ position 2 โ |
| Pass 5 | [20, 30, 50, 60, 70] | Sorted! โ |
2024 paper asked you to show 5 passes of bubble sort on [50, 70, 30, 60, 20]. Examcraft 2023 asked you to perform it on [9, 4, 1, 8, 6]. ALWAYS show each pass as a row and highlight what moved.
| Time Complexity | Details |
|---|---|
| Best case | O(n) โ already sorted list with early-exit flag |
| Average/Worst case | O(nยฒ) โ nested loops, many comparisons and swaps |
Insertion Sort builds a sorted list one element at a time. Take the next unsorted element and insert it into its correct position in the already-sorted portion by comparing and shifting elements rightward.
Like sorting playing cards in your hand โ you pick up a new card and slide it left into the right position among the cards you're already holding. Each new card finds its place!
| Pass | Key | Action | List after |
|---|---|---|---|
| 1 | 2 | 2 < 7 โ shift 7 right, insert 2 | [2, 7, 4, 1, 5] |
| 2 | 4 | 4 < 7 โ shift 7; 4 > 2 โ insert | [2, 4, 7, 1, 5] |
| 3 | 1 | 1 < 7,4,2 โ shift all; insert 1 | [1, 2, 4, 7, 5] |
| 4 | 5 | 5 < 7 โ shift 7; 5 > 4 โ insert | [1, 2, 4, 5, 7] |
๐ Insertion = "Insert each card into its correct place in the hand". Best case = O(n) when already sorted (no shifts needed). Worst case = O(nยฒ) when reverse sorted (maximum shifts).
| Time Complexity | Details |
|---|---|
| Best case | O(n) โ already sorted, just one comparison per element |
| Average/Worst case | O(nยฒ) โ reverse sorted, maximum shifts each pass |
Selection Sort repeatedly finds the minimum value in the unsorted portion and places it at the start of that portion (by swapping). After each pass, one more element is in its final position.
Like a teacher picking the shortest student first and placing them at the front, then picking the next shortest, and so on. You're always selecting the smallest remaining item!
| Pass | Min found | Swap | List after |
|---|---|---|---|
| 1 | 11 (index 4) | 11 โ 64 | [11, 25, 12, 22, 64] |
| 2 | 12 (index 2) | 12 โ 25 | [11, 12, 25, 22, 64] |
| 3 | 22 (index 3) | 22 โ 25 | [11, 12, 22, 25, 64] |
| 4 | 25 (index 3) | already there | [11, 12, 22, 25, 64] |
๐ฏ "Selection = always Selecting the Smallest". Unlike bubble sort which moves things around a lot, selection sort makes exactly n-1 swaps total.
Always O(nยฒ) regardless of input order โ no best-case optimisation like bubble/insertion. 2022 paper gave a two-list version โ know both in-place (swap) and two-list versions.
Quicksort is a divide-and-conquer algorithm. Choose a pivot element; partition the list into elements โค pivot (left) and elements > pivot (right); then recursively sort each partition.
Like organising a pile of books by price. Pick one book as a "pivot". Put all cheaper books on the left, all more expensive on the right. Now do the same thing separately on the left pile and right pile. Keep dividing until everything is sorted!
Press "Step" to partition around the pivot (shown in pink).
If pivot = 90 (the maximum), left partition = all 8 other elements, right partition = empty. No meaningful split occurs โ this degrades to O(nยฒ) because we do n comparisons, then n-1, then n-2... same as Bubble Sort. Good pivot strategies: pick the median of first/middle/last elements, or a random element.
| Step | Action | Result |
|---|---|---|
| Pivot | Choose 13 as pivot | pivot = 13 |
| Left (โค13) | 10, 13 โค 13 | [10] | 13 |
| Right (>13) | 29, 14, 37 > 13 | [29, 14, 37] |
| Next step | Recursively sort [10] (already sorted) and [29,14,37] | Continue... |
| Time Complexity | Details |
|---|---|
| Best case | O(n log n) โ pivot always splits into two equal halves |
| Average case | O(n log n) โ with random or median pivot selection |
| Worst case | O(nยฒ) โ when pivot is always the largest/smallest element |
โก Quicksort = Quick in practice (O(n log n) average), but can be Slow with a bad pivot (O(nยฒ)). Always choose a good pivot!
Binary Search finds a target in a sorted list by repeatedly halving the search space. Compare the target to the middle element: if equal = found; if target is smaller = search left half; if larger = search right half.
Like finding a name in a phone book โ open to the middle, decide which half has the name, repeat. You never look at the wrong half again! Much faster than reading every page!
low = 0, high = len(list) - 1.mid = (low + high) // 2.list[mid] == target โ return mid (found!).target < list[mid] โ set high = mid - 1 (search left half).target > list[mid] โ set low = mid + 1 (search right half).low > high (not in list).| Step | low | high | mid | list[mid] | Action |
|---|---|---|---|---|---|
| 1 | 0 | 6 | 3 | 22 | 37 > 22 โ low = 4 |
| 2 | 4 | 6 | 5 | 51 | 37 < 51 โ high = 4 |
| 3 | 4 | 4 | 4 | 37 | โ Found at index 4! |
๐ Binary Search = always halves the list. List of 1,000 items needs at most 10 comparisons (because 2ยนโฐ = 1,024). That's why it's O(log n)!
2023 paper: trace a Python binary search function โ identify the iteration (while loop), explain what happens when target not found (return len(L) instead of -1). Know this quirk!
| โ Advantage of sorting | โ Disadvantage of sorting |
|---|---|
| Enables fast binary search (O(log n) vs O(n)) | Sorting itself takes time โ O(n log n) or worse |
| Easier to find duplicates and generate reports | If data changes frequently, must re-sort often (costly) |
| Algorithm | Type | Best | Average | Worst | Sorted input required? |
|---|---|---|---|---|---|
| Linear Search | Search | O(1) | O(n) | O(n) | โ No |
| Binary Search | Search | O(1) | O(log n) | O(log n) | โ YES |
| Bubble Sort | Sort | O(n)* | O(nยฒ) | O(nยฒ) | N/A โ it sorts |
| Insertion Sort | Sort | O(n)* | O(nยฒ) | O(nยฒ) | N/A โ it sorts |
| Selection Sort | Sort | O(nยฒ) | O(nยฒ) | O(nยฒ) | N/A โ it sorts |
| Quicksort | Sort | O(n log n) | O(n log n) | O(nยฒ) | N/A โ it sorts |
* O(n) best case requires early-exit flag on already-sorted list
The most common exam questions: (1) Perform an algorithm step by step. (2) State the Big O complexity. (3) Compare two algorithms. (4) Explain why Quicksort can degrade to O(nยฒ). (5) State one improvement to Bubble Sort (early-exit flag).
Click a card to flip it. Filter by chapter to focus your revision.
?Loading...
Tap to reveal โป
Test your knowledge across all three chapters. Past-paper style questions!